Skip to content

fixes hip-tests using system rocm installation with TheRock#3880

Closed
tcgu-amd wants to merge 6 commits into
developfrom
tcgu/hip-tests-the-rock-fix
Closed

fixes hip-tests using system rocm installation with TheRock#3880
tcgu-amd wants to merge 6 commits into
developfrom
tcgu/hip-tests-the-rock-fix

Conversation

@tcgu-amd
Copy link
Copy Markdown
Contributor

@tcgu-amd tcgu-amd commented Mar 9, 2026

Motivation

hip-tests picks up system rocm installation when building with TheRock because it hard sets ROCM_PATH env variable to /opt/rocm

Technical Details

In CMakeLists.txt, ROCM_PATH is hard-coded to be set to /opt/rocm when not defined. Since TheRock always unsets ROCM_PATH for all subprojects, this leads to ROCM_PATH always picking up the system installation as long as there is one.

JIRA ID

N/A

Test Plan

Ran locally to confirm behavior.

Test Result

Passed.

Submission Checklist

Copilot AI review requested due to automatic review settings March 9, 2026 17:38
@tcgu-amd tcgu-amd requested review from a team as code owners March 9, 2026 17:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts hip-tests’ ROCm path resolution so builds under TheRock don’t unintentionally pick up a system /opt/rocm installation, ensuring the build uses the intended ROCm/HIP from the build environment.

Changes:

  • Gate the default ROCM_PATH=/opt/rocm behavior behind a TheRock-specific condition.
  • Preserve fallback to HIP_PATH when ROCM_PATH is missing or invalid.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread projects/hip-tests/catch/CMakeLists.txt Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tcgu-amd tcgu-amd self-assigned this Mar 10, 2026
@tcgu-amd tcgu-amd requested a review from ScottTodd March 10, 2026 17:27
Comment thread projects/hip-tests/catch/CMakeLists.txt Outdated
Comment on lines 52 to 54
if(DEFINED THEROCK_SUPERPROJECT_INCLUDE_DIRS)
# When building under TheRock superproject, default ROCM_PATH to HIP_PATH
set(ROCM_PATH ${HIP_PATH})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like the right fix. In general, subprojects shouldn't need to know anything about a particular superproject like TheRock.

We need to rip out all hardcoded uses of /opt/rocm/. See also discussion at ROCm/TheRock#3825

Copy link
Copy Markdown
Contributor Author

@tcgu-amd tcgu-amd Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ScottTodd Thanks for looping me into the discussion! In that case, for this particular fix, we could simply just remove the condition and always set ROCM_PATH to HIP_PATH. TheRock check was added only in the spirit of being conservative and preserving the original /opt/rocm build logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@mangupta mangupta requested a review from cjatin March 11, 2026 07:40
@tcgu-amd
Copy link
Copy Markdown
Contributor Author

Closing in favor of more systematic refactor.

@tcgu-amd tcgu-amd closed this Mar 25, 2026
@tcgu-amd tcgu-amd deleted the tcgu/hip-tests-the-rock-fix branch March 25, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants